﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DVDFilmoteka.src.Exporters
{
    public class ExporterFactory
    {
        private static Dictionary<String, IDatabaseExporter> exporters = null;

        public static IDatabaseExporter GetExporter(String name)
        {
            if (exporters == null)
            {
                exporters = new Dictionary<string, IDatabaseExporter>();

                exporters.Add("txt", new TXTDatabaseExporter());
                exporters.Add("xlsx", new ExcelDatabaseExporter());
            }

            if (exporters.ContainsKey(name))
            {
                return exporters[name];
            }
            else
            {
                return null;
            }
        }
    }
}
